package org.linxiangyu.juanorm;

import java.util.HashMap;
import java.util.Map;

/**
 * Author: linxiangyu
 * Date:   13-11-8
 * Time:   下午3:17
 */
public class Type {
    public String sqlType;
    public Class javaType;
    public String sqlCreateStatement;
    public String fieldName;

    public Map<Class<?>, String> javaToSqlMap;

    public void init(){
        javaToSqlMap = new HashMap<Class<?>, String>();
        javaToSqlMap.put(Integer.class, "INTEGER");
        javaToSqlMap.put(Double.class, "DOUBLE");
        javaToSqlMap.put(String.class, "TEXT");

    }

    public String getSqlType(){
        return  javaToSqlMap.get(javaType);
    }

    public String getCreateString(){
        return fieldName + " " + getSqlType();
    }

}
